package travel;

import java.util.Random;

public class TravelService {
	private String name;

	public TravelService() {
		super();
	}

	public TravelService(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	// 预定酒店
	public boolean bookHotel(Hotel hotel) {
		Random rand = new Random();
		boolean nextBoolean = rand.nextBoolean();
		System.out.println("酒店预定" + (nextBoolean ? "成功":"失败"));
		return nextBoolean;
	}
	// 购买门票
	public int buyTicket(Spots spots) {
		System.out.println("景点门票已经购买");
		return spots.getTicket() + 100;
	}
}	
